package com.haust.su.ghyy.hospital.controller;

import com.haust.su.ghyy.common.result.Result;
import com.haust.su.ghyy.hospital.service.DepartmentService;
import com.haust.su.ghyy.model.hosp.Department;
import com.haust.su.ghyy.vo.hosp.DepartmentVo;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author haustsusu
 * @create 2023-04-29-18:17
 */
@RestController
@RequestMapping("/admin/hosp/departSchedule")
//@CrossOrigin
public class DepartSchedulController {

    @Autowired
    private DepartmentService departmentService;

    //根据医院的编号,查询医院的所有科室列表
    @ApiOperation(value = "查询医院所有的科室信息")
    @GetMapping("getDeptList/{hoscode}")
    public Result getDeptList(@PathVariable String hoscode){
        List<DepartmentVo> list=departmentService.findDeptTree(hoscode);
        return Result.ok(list);

    }
}
